cmake_minimum_required(VERSION 3.5)

project(QPainterDemo LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_compile_options(/wd4819 /wd4005 /wd4834 /wd4996 /utf-8 /openmp)

message("============== Res Setup ==============")

set(RESOURCE_DIR "${CMAKE_SOURCE_DIR}/resources")
message(STATUS "Resource dir: ${RESOURCE_DIR}")
# 查找 resource 目录下的所有 qrc 文件
file(GLOB_RECURSE QRC_FILES "${RESOURCE_DIR}/*.qrc")
# 将所有 qrc 文件的路径保存到一个全局变量中
set(GLOBAL_QRC_FILES ${QRC_FILES})


# 添加core目录下的头文件到项目
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/core)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui)

find_package(Qt5 COMPONENTS Widgets REQUIRED)


add_subdirectory(core)  # core代码
add_subdirectory(app)  # svr项目



